const express = require("express");
const router = express.Router();
const path = require("path");

router.get("/:filename", (req, res) => {
    const filePath = path.resolve(__dirname, "../../public/uploads", req.params.filename);
    res.download(filePath,req.params.filename);
});

module.exports = router;